package presentacion;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class RenderColorines extends DefaultTableCellRenderer{
	
	   public Component getTableCellRendererComponent(JTable table,
	      Object value,
	      boolean isSelected,
	      boolean hasFocus,
	      int row,
	      int column)
	   {
	      super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
	      
	     
	      
	    	 if ((Integer)value>0){
	         this.setBackground(Color.GREEN);
	      }else if ((Integer)value<0){
	    	  this.setBackground(Color.RED);
	      }
	   
	      return this;
	   }
	
}
